<!-- 日期范围控件 -->
<template>
  <a-range-picker
    :show-time="getProps.showTime"
    :format="getProps.dateFormat"
    v-model="modelValue"
    :placeholder="getProps.placeholder"
    :disabled="disabled"
  />
</template>

<script lang="ts" setup>
const props = withDefaults(
  defineProps<{
    props: { [propName: string]: any };
    name?: string;
    required?: boolean;
    oneValue: any;
    disabled?: boolean;
    regex?: {
      [name: string]: {
        role: any;
        name: any;
      };
    };
  }>(),
  {}
);
const emit = defineEmits(['update:oneValue']);
const modelValue = computed({
  get: () => {
    return props.oneValue ? props.oneValue : '';
  },
  set: (val) => {
    emit('update:oneValue', [val[0], val[1]]);
  }
});
//复制一份props
const getProps = computed(() => {
  return props.props;
});
</script>

<style scoped lang="less"></style>
